# _*_ coding: utf-8 _*_
import pygame
import sys
from pygame import locals

# 用None来判断模块是否存在
if pygame.transform is None:
    print("transform is not available")
else:
    print("transform is available")

#简单的示例
bgimgStr="bgimg.jpg"
mouseimgStr="mouseimg.png"
pygame.init()
#屏幕窗口，set_mode会返回一个Surface对象
screen=pygame.display.set_mode((700,600),0,32)
#窗口标题
pygame.display.set_caption("pygame实例")
#加载图片
bgimg=pygame.image.load(bgimgStr)
mouseimg=pygame.image.load(mouseimgStr)


# 游戏主循环
while True:
    for event in pygame.event.get():
        if event.type == locals.QUIT:
            exit()
    screen.blit(bgimg, (0, 0))
    x,y=pygame.mouse.get_pos()
    x-=mouseimg.get_width()/2
    y-=mouseimg.get_height()/2
    screen.blit(mouseimg,(x,y))
    pygame.display.update()
pygame.quit()

